<template>
    <van-row>
        <van-col span="8">
            <van-sidebar v-model="active">
                <van-sidebar-item v-for="time in categoriesApidata" :title="time.cat_name" />

            </van-sidebar>
        </van-col>
        <van-col span="16">
            <div v-if="gjp">
                <van-skeleton title :row="20" />
            </div>
            <div v-else v-for="time in categoriesApidata[active]?.children">
                <router-link >
                <van-grid :column-num="4">
                    <van-grid-item v-for="time in time.children"  :icon="time.cat_icon" :text="time.cat_name" />
                </van-grid>
                </router-link>
            </div>
        </van-col>

    </van-row>

</template>

<script setup>
import { ref } from 'vue';
import { categoriesApi } from '@/api/api'
let categoriesApidata = ref([])
let gjp=ref(true)
categoriesApi().then((res) => {
    console.log(res);
    categoriesApidata.value = res.data.message
    if(gjp.value>0){
        gjp.value=false
    }

})
let active = ref(0)
</script>

<style lang="scss" scoped></style>